package com.bootdo.shop.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.bootdo.shop.dao.SpecificationDao;
import com.bootdo.shop.domain.SpecificationDO;
import com.bootdo.shop.service.SpecificationService;



@Service
public class SpecificationServiceImpl implements SpecificationService {
	@Autowired
	private SpecificationDao specificationDao;
	
	@Override
	public SpecificationDO get(Long specificationId){
		return specificationDao.get(specificationId);
	}
	
	@Override
	public List<SpecificationDO> list(Map<String, Object> map){
		return specificationDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return specificationDao.count(map);
	}
	
	@Override
	public int save(SpecificationDO specification){
		specification.setCreateTime(new Date());
		return specificationDao.save(specification);
	}
	
	@Override
	public int update(SpecificationDO specification){
		specification.setUpdateTime(new Date());
		return specificationDao.update(specification);
	}
	
	@Override
	public int remove(Long specificationId){
		return specificationDao.remove(specificationId);
	}
	
	@Override
	public int batchRemove(Long[] specificationIds){
		return specificationDao.batchRemove(specificationIds);
	}
	
}
